package com.sky.controller.user;

import com.sky.dto.CategoryDTO;
import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.management.openmbean.TabularType;
import java.util.List;

@RequestMapping("/user/category")
@RestController("userCategoryController")
@Slf4j
@Api(tags = "C端-分类接口")
public class CategoryController {
        @Autowired
        private CategoryService categoryService;


    /** sr
     *按照类型查询分类
     * @param list
     * @return
     */
    @GetMapping("/list")
        @ApiOperation("分类条件查询")
        public Result<List<Category>> getCategory(Integer list){
        log.info("分类条件查询:{}",list);
        List<Category> category = categoryService.get(list);
        return Result.success(category);
    }


}
